package com.epoint.mobileoa.ui.wsgw.task;

import java.util.Map;

import android.os.Message;

import com.epoint.mobileoa.R;
import com.epoint.mobileoa.bizlogic.NewTask;
import com.epoint.mobileoa.bizlogic.SuperView;
import com.epoint.mobileoa.tools.WebServiceUtilDAL;
import com.epoint.mobileoa.ui.wsgw.model.Handle_GetUnHandleList_Model;

/**
 * @author liyc
 * @time 2012-12-18 上午10:17:11
 * @annotation 
 */
public class GetDbDetailTask extends NewTask {



	/**
	 * @param sv
	 * @param taskID
	 * @param param
	 * @param progressMsg
	 * @param progressDialogType
	 */
	public GetDbDetailTask(SuperView sv, int taskID, Map<String, Object> param,
			String progressMsg, int progressDialogType) {
		super(sv, taskID, param, progressMsg, progressDialogType);
	}

	@Override
	public void exectue(Message mess) throws Exception {
		Handle_GetUnHandleList_Model h = (Handle_GetUnHandleList_Model) getParam().get("model");
		String url = sv.getString(R.string.gw_ws_url);
		String namespace = sv.getString(R.string.WS_namespace);
		String method = "Handle_GetArchive";
		WebServiceUtilDAL webservice = new WebServiceUtilDAL(url,
				method, namespace);
		
		String ParasXml = "<?xml version=\"1.0\" encoding=\"gb2312\"?>"+
				"<paras>"+
				"<UserGuid>%s</UserGuid>"+
				"<MessageItemGuid>%s</MessageItemGuid>"+
				"</paras>";
		ParasXml = String.format(ParasXml,getSv().fp.getUserguid(),h.MessageItemGuid);
		webservice.addProperty("ValidateData", sv.getString(R.string.WS_ValidateData));
		webservice.addProperty("ParasXml", ParasXml);
		String bs = webservice.start();
		setMessageToRefreshUI(mess, bs);
	}

}
